package ar.com.softtek.departments.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import ar.com.softtek.departments.dao.DepartmentDao;
import ar.com.softtek.departments.model.Department;

@Controller
public class DepartmentsController {
	@Autowired
	private DepartmentDao departmentDao;

	@ModelAttribute("departments")
	public List<Department> getDepartments() {
		return departmentDao.findAll();
	}

	@RequestMapping("/manageDepartments.html")
	public String handleRequest() {
		return "manageDepartments";
	}
}
